package cn.tedu._05weibo3.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Pattern;

@Data
public class UserRegDTO {
    @ApiModelProperty(value = "用户名", required = true)
    @Pattern(regexp = "^[a-zA-Z0-9_]{5,20}$", message = "用户名应为5到20位的字母、数字或下划线")
    private String username;

    @ApiModelProperty(value = "密码", required = true)
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[A-Za-z\\d]{8,}$", message = "密码需包含至少一个小写字母、一个大写字母和一个数字，长度在8位以上")
    private String password;

    @ApiModelProperty(value = "昵称", required = true)
    @Pattern(regexp = "^[a-zA-Z0-9_\\u4e00-\\u9fa5]{2,10}$", message = "昵称应为2到10位的中英文、数字或下划线")
    private String nickname;
}
